[Flex] How to open a menu automatically with a shortcut ?

Posted by Sris on Stack Overflow See other posts from Stack Overflow or by Sris
Published on 2010-03-24T06:23:57Z Indexed on 2010/03/24 6:33 UTC
Read the original article Hit count: 495

Filed under:
|
|
|

Hi there

I have a MenuBar which contains general menu items like File, View, Tools ,Help. I have sub items in each of those menuitems. The problem is that i want to open the 'File' menu automatically when i press Alt+f key. I could capture the keyevents on the view.

But how to open the File Menu of the MenuBar (what is the function that needs to be called from MenuBar Class to popup those sub menuitems) ? I have searched for some information on google .. but cudnt find. or else if u have any better solution or example ..plz do post it.

<root>
    <menuitem label="File">
        <menuitem label="New" enabled="false"/>
        <menuitem label="Open.." enabled="false"/>
        <menuitem label="Save" enabled="false"/>
        <menuitem label="Restore" enabled="false"/>
        <menuitem label="Print" enabled="true"/> 
        <menuitem type="seperator" enabled="false"/> 
        <menuitem label="Exit" enabled="true"/>    
    </menuitem> 
    <menuitem label="View" accesskey="v">
        <menuitem label="Zoom In" enabled="true" maxValue="200"/>
        <menuitem label="Zoom Out" enabled="true" maxValue="25"/>
    </menuitem>       
    <menuitem label="Tools" enabled="false">
        <menuitem label="item1" enabled="false"/>
        <menuitem label="item2" enabled="false"/>
    </menuitem> 

</root>

Thanks in advance :)

Sriss

© Stack Overflow or respective owner

Related posts about flex

Related posts about menubar